#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	int n;
	int i,t,g=0,p=0,min1,result;
	cin>>n;
	for (i=2;;i++)
	{
		t = sqrt(i);
		for (g=1;g<(t+1);g++)
		{
			 if (g==1) continue;
			 else if (i%g==0)
			 {
			 	p = 1;
			 	break;
			 }
			 else continue;
		}
		if (p==1)
		{
			p = 0;
			continue;
		}
		else if (n%i==0)
		{
			min1 = i;
			break;
		}
		else
		{
			p = 0;
			continue;
		}
	}
	result = n / min1;
	cout<<result<<endl;
	return 0;
}
